#pragma once

#include <mutex>
#include <iostream>

static std::mutex cout_mutex;
#ifndef COUT
#define __SHORT_FILE__ (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__)
#define COUT(msg)                        \
    {                                     \
        std::lock_guard<std::mutex> lock(cout_mutex); \
        std::cerr << __SHORT_FILE__ << ":" << __LINE__ << " -" << __FUNCTION__ << "()--" << msg << std::endl; \
    }
#endif // !COUT
